SET( LIB_NAME OpenIG-Plugin-CIGI )
SET( TARGET_OTHER_FILES DataFiles/libIgPlugin-CIGI.so.xml )

SET( _IgPluginCIGI
    IGPluginCIGI.cpp
    ${TARGET_OTHER_FILES}
)

ADD_LIBRARY( ${LIB_NAME} SHARED
    ${_IgPluginCIGI}
)

INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS} ${CCL_INCLUDE_DIR})

TARGET_LINK_LIBRARIES( ${LIB_NAME}
    ${OSG_LIBRARIES}
    OpenIG-Engine
    OpenIG-Networking
    ${BOOST_LIBRARIES}
    ${CCL_LIBRARIES}
)

SET_TARGET_PROPERTIES( ${LIB_NAME} PROPERTIES VERSION ${OPENIG_VERSION} )
SET_TARGET_PROPERTIES( ${LIB_NAME} PROPERTIES SOVERSION ${OPENIG_VERSION} )
SET_TARGET_PROPERTIES( ${LIB_NAME} PROPERTIES PROJECT_LABEL "Plugin CIGI" )

INCLUDE( PluginInstall REQUIRED )

IF (APPLE)
    INSTALL(FILES ${CMAKE_CURRENT_LIST_DIR}/DataFiles/libIgPlugin-CIGI.so.xml DESTINATION ${INSTALL_LIBDIR} RENAME libOpenIG-Plugin-CIGI.dylib.xml)
ELSEIF(WIN32)
    INSTALL(FILES ${CMAKE_CURRENT_LIST_DIR}/DataFiles/libIgPlugin-CIGI.so.xml DESTINATION ${INSTALL_BINDIR} RENAME OpenIG-Plugin-CIGI.dll.xml)
ELSE()
    INSTALL(FILES ${CMAKE_CURRENT_LIST_DIR}/DataFiles/libIgPlugin-CIGI.so.xml DESTINATION ${INSTALL_LIBDIR} RENAME libOpenIG-Plugin-CIGI.so.xml)
ENDIF()
